package cn.middle.edge.config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.thymeleaf.spring5.view.ThymeleafViewResolver;

import cn.dev33.satoken.stp.StpUtil;


@Configuration
public class ThymeleafInjectionSaTokenStp {
	
    // 为 Thymeleaf 注入全局变量，以便在页面中调用 Sa-Token 的方法 
    @Autowired
    private void configureThymeleafStaticVars(ThymeleafViewResolver viewResolver) {
    	//StpUtil.stpLogic.isLogin();
        viewResolver.addStaticVariable("stp", StpUtil.stpLogic);
    }

}